/*
 * @Author: cmd 
 * @wechat: cmd_develop 
 * @Date: 2019-04-25 14:57:59 
 * @Last Modified by: cmd
 * @Last Modified time: 2019-04-25 15:16:17
 * @Description: 
 */

const {ccclass, property} = cc._decorator;

@ccclass
export default class load_json extends cc.Component {

    load_json(json_name:string) {
			let json_url = 'json/' + json_name;
			return new Promise((resolve, reject) => {
				cc.loader.loadRes(json_url, (err, data: cc.JsonAsset) => {
					if (err) {
						reject(err);
					} else {
						resolve(data.json);
					}
				});
			});
		}
}
